'\" te
.\" CDDL HEADER START
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\" CDDL HEADER END
.\"
.\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
.\"
.\" -*- nroff -*-
.\"
.TH IBV_REGISTER_SM_EVENTS 3 2012-08-08 libibverbs "Libibverbs Programmer's Manual"
.SH "NAME"
ibv_register_sm_events, ibv_unregister_sm_events \- registers or unregisters
the specified subnet events for the specified GID(s).
.sp
.SH "SYNOPSIS"
.nf
.B #include <infiniband/verbs.h>
.sp
.BI "int ibv_register_sm_events(struct ibv_context *context,
.BI "ibv_sm_event_type_t event, int gid_num, union ibv_gid *gids)
.sp
.BI "int ibv_unregister_sm_events(struct ibv_context *context,
.BI "ibv_sm_event_type_t event, int gid_num, union ibv_gid *gids)
.if
.TP
.B context:\fR Device context
.TP
.B event:\fR
Logical OR of events to register for, valid values are:
.TP
.in +5
.B IBV_SM_EVENT_MGID
.in -5
.in +15
.B Request notification of Multicast GID events
.in -15
.TP
.in +5
.B IBV_SM_EVENT_UGID
.in -5
.in +15
.B Request notification of Unicast GID events
.in -15
.TP
.in +5
.B IBV_SM_EVENT_UGID_ALL
.in -5
.in +15
.B Request notification of ALL Unicast GID events
.in -15
.TP
.in +5
.B IBV_SM_EVENT_MGID_ALL
.in -5
.in +15
.B Request notification of ALL Multicast GID events
.in -15
.TP
.in +5
.B IBV_SM_EVENT_ALL
.in -5
.in +15
.B Request notification of ALL Multicast and Unicast GID events
.in -15
.TP
.B gid_num:
0 or the number of gids in the array of gids pointed to by gids.
.TP
.B gids:
NULL, or an array of GIDS.
.sp
.SH "DESCRIPTION"
.B ibv_register_sm_events()
registers for the specified subnet events for the specified GID(s).
ibv_unregister_sm_events() unregisters for the specified subnet events
for the specified GID(s). These events are delivered on the async fd
(see ibv_get_async_event(3)), from a previously opened device (see
ibv_open_device()). It is only necessary to call ibv_register_sm_events()
on a single device connected to each unique fabric, partition. For
example, if a node has 4 HCAs attached to the same fabric, with all
ports in the same partition, then it is only necessary to call
ibv_register_sm_events() on one of them.
.sp
.TP
.B The following ibv_event_type events can be passed to
ibv_register_sm_events():
.TP
.in +5
.B IBV_EVENT_MCG_CREATED
.in -5
.in +12
An MCG specified by the new "gid" member of the ibv_async_event
struct has been created. 
.in -12
.TP
.in +5
.B IBV_EVENT_MCG_DELETED
.in -5
.in +12
The MCG specified by the "gid" member of the ibv_async_event struct
has been deleted. 
.in -12
.TP
.in +5
.B IBV_EVENT_GID_AVAIL
.in -5
.in +12
The GID specified by the "gid" member of the ibv_async_event struct
is available on this subnet.
.in -12
.TP
.in +5
.B IBV_EVENT_GID_UNAVAIL
.in -5
.in +12
The GID specified by the "gid" member of the ibv_async_event struct
is no longer available on this subnet.
.in -12
.sp
.SH "RETURN VALUE"
.B ibv_register_sm_events(), ibv_unregister_sm_events()
returns 0 on success, and \-1 on error.
.SH "NOTES"
.TP
